<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;

use App\Http\Requests;
//使用类
use App\Http\Controllers\Controller;

class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
   public function index(Request $request)
    {   


    	$count = $request -> input('count',10);
        $search = $request -> input('search','');
        $request = $request -> all();
            //状态 0 未激活 1 激活 2 黑名单
        //dd($request);
            //查询会员所有数据
		  $data = \DB::table('user')
            ->leftJoin('userdetails', 'user.id', '=', 'userdetails.uid')
            ->where("userdetails.nickname",'like','%'.$search.'%')
            ->orWhere("user.tel",'like','%'.$search.'%')
            ->paginate($count);

            //dd($data);
        
        // 加载页面

       return view("admin.user.index")->with('data',$data)->with("request",$request);

    }

   
}
